package com.example.homework02.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.support.MultipartFilter;

import java.io.File;
import java.io.IOException;

@Controller
@RequestMapping("/user")
public class FileController {
    @RequestMapping(value = "/quick",method = RequestMethod.POST)
    @ResponseBody
    public String quick01(MultipartFile file) throws IOException,NullPointerException {
        String uploadFile = file.getOriginalFilename();
        file.transferTo(new File("C:\\load\\"+ uploadFile));
        return "000";
    }
}
